package com.societyGames.codeAlong.state.codeExercise.model.help
{
	import com.societyGames.system.IXmlInitialize;
	
	import flash.utils.getDefinitionByName;
	
	public class ExceptionHelpFactory
	{
		private static var idExceptionHelp:IdExceptionHelp;
		
		public static function create(xml:XML):IExceptionHelp
		{
			var className:String = "com.societyGames.codeAlong.state.codeExercise.model.help." + xml.@type;
			var helpClass:Class = Class(getDefinitionByName(className));
			var exceptionHelp:IExceptionHelp = IExceptionHelp(new helpClass());
			IXmlInitialize(exceptionHelp).initializeWithXml(xml);
			return exceptionHelp;
		}
	}
}